package model

import (
	"gorm.io/gorm"
	"time"
)

type Comment struct {
	Id        uint32         `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" form:"id" json:"id"`
	UserId    int32          `gorm:"column:user_id;type:int;comment:用户id;not null;" form:"userId" json:"user_id"`                                               // 用户id
	VideoId   int32          `gorm:"column:video_id;type:int;comment:视频id;not null;" form:"videoId" json:"video_id"`                                            // 视频id
	Context   string         `gorm:"column:context;type:int;comment:视频id;not null;" form:"context" json:"context"`                                              // 视频id
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);comment:评论时间;not null;default:CURRENT_TIMESTAMP(3);" form:"createdAt" json:"created_at"` // 评论时间
	LikeNum   int32          `gorm:"column:like_num;type:int;comment:点赞数量;not null;" form:"likeNum" json:"like_num"`                                            // 点赞数量
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" form:"updatedAt" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" form:"deletedAt" json:"deleted_at"`
}

func (c Comment) TableName() string {
	return "comment"
}
